package fristphase.day9_07.my_plane_battle;

import javax.swing.*;
import java.util.Random;

public class Bee extends FlyingObject implements EnemyAward{
    Bee(){
        super(60,50);
    }
    public void step(){
        x += speed;
        y += speed;
    }
    int index = 0;
    public ImageIcon getImage(){
        ImageIcon img = null;
        if(state == LIVE){
            img = Images.bee;
        }else if (state == DEAD){
            img = Images.boms[index++];
            if(index == 4){
                state = REMOVE;
            }
        }
        return img;
    }
    public int getAwardType(){
        Random random = new Random();
        int type = random.nextInt(10);
        if(type<5){
            return 0;
        }else {
            return 1;
        }
    }
}
